package com.zy.ems.common.enums;

/**
 * 会员等级。
 * 
 * @author Luffy
 *
 */
public enum MemberLevelInfo {
    //
    level1(1, "普通会员", "", "", 1, 1, 0, 0),
    //
    level2(2, "白银会员", "baiyin.gif", "双倍积分", 0.99, 1, 5000, 10000),
    //
    level3(3, "黄金会员", "huangjin.gif", "三倍积分", 0.98, 1, 50000, 200000),
    //
    level4(4, "白金会员", "baijin.gif", "四倍积分", 0.97, 1, 80000, 400000),
    //
    level5(5, "钻石会员", "xing01.gif", "五倍积分", 0.96, 1, 130000, 600000),
    //
    level6(6, "双钻会员", "xing02.gif", "五倍积分", 0.95, 1, 200000, 800000),
    //
    level7(7, "三钻会员", "xing03.gif", "五倍积分", 0.94, 1, 290000, 1000000),
    //
    level8(8, "四钻会员", "xing04.gif", "五倍积分", 0.93, 1, 400000, 1200000);

    private int id;

    private String name;

    private String img;

    private String coupon;

    private double discount_rule_n;

    private int discount_rule_s;

    private int level_condition_order;

    private int level_condition_total;

    private MemberLevelInfo(int id, String name, String img, String coupon,
            double discount_rule_n, int discount_rule_s,
            int level_condition_order, int level_condition_total) {
        this.id = id;
        this.name = name;
        this.img = img;
        this.coupon = coupon;
        this.discount_rule_n = discount_rule_n;
        this.discount_rule_s = discount_rule_s;
        this.level_condition_order = level_condition_order;
        this.level_condition_total = level_condition_total;
    }

    public static MemberLevelInfo getInfo(int level) {
        for (MemberLevelInfo memberLevel : values()) {
            if (level == memberLevel.getId()) {
                return memberLevel;
            }
        }
        return level1;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getImg() {
        return img;
    }

    public String getCoupon() {
        return coupon;
    }

    public double getDiscount_rule_n() {
        return discount_rule_n;
    }

    public int getDiscount_rule_s() {
        return discount_rule_s;
    }

    public int getLevel_condition_order() {
        return level_condition_order;
    }

    public int getLevel_condition_total() {
        return level_condition_total;
    }

}
